package com.demo.service.impl;

import com.demo.dao.StudentDao;
import com.demo.dao.impl.StudentDaoImpl;
import com.demo.entity.Student;
import com.demo.service.StudentService;

import java.util.List;

/**
 * @author wzm
 * @create 2023-06-29 9:32
 */
public class StudentServiceImpl implements StudentService {
  //调用dao中的方法实现功能
   private StudentDao studentDao = new StudentDaoImpl();

    @Override
    public boolean add(Student student) {
        return studentDao.insertStu(student) > 0;
    }

    @Override
    public boolean delete(Student student) {
        return studentDao.deleteStu(student) > 0;
    }

    @Override
    public boolean update(Student student) {
        return studentDao.updateStu(student) > 0;
    }

    @Override
    public List<Student> findByLike(Student student) {
        return studentDao.selectByLike(student);
    }
}
